Skip to content

chore(selfhost): remove orphaned register-selfhost.mjs Docker entrypoint script - #2937

Merged
JSONbored merged 1 commit into
mainfrom
claude/register-selfhost-orphan-2909
Jul 4, 2026
Merged

chore(selfhost): remove orphaned register-selfhost.mjs Docker entrypoint script#2937
JSONbored merged 1 commit into
mainfrom
claude/register-selfhost-orphan-2909

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

scripts/register-selfhost.mjs's own header comment claimed it was used as the Docker entrypoint via node --import ./scripts/register-selfhost.mjs dist/server.mjs, providing a runtime node:module resolution hook that stubs any cloudflare:* import. But Dockerfile:68's actual CMD is ["node", "dist/server.mjs"] — no --import flag — and no other script, doc, or CI step ever invoked it that way. The only other reference was a stale path filter in .github/workflows/selfhost.yml that just triggered the workflow when the file changed, not an actual runtime dependency.

Verified empirically before removing, not just by inspection (per this issue's own requirement to confirm the build-time stub actually covers everything the runtime hook covered):

  • Rebuilt the self-host bundle with node scripts/build-selfhost.mjs --all — the exact mode Dockerfile:19 uses (RUN node scripts/build-selfhost.mjs --all), which bundles every dependency (including transitive node_modules internals) into one self-contained file.
  • Grepped the resulting ~7.5MB dist/server.mjs for the literal string cloudflare:zero matches.

Since --all mode traverses and inlines the entire reachable dependency graph, this is a complete check, not a superficial one: if any transitive dependency anywhere had its own internal cloudflare:sockets/cloudflare:email/etc. import, it would have been bundled and shown up in that grep. It didn't. The build-time esbuild plugin (cloudflare:workerscf-workers-shim.ts, @cloudflare/puppeteer → a local stub, agents/mcp → a local stub) already eliminates every reachable cloudflare:* specifier from the actual Docker image, so the runtime --import hook was fully redundant.

Resolves #2909. Part of the #1667 self-host review-stack roadmap.

Scope

Validation

  • git diff --check
  • npm run typecheck
  • npm run actionlint — validates the .github/workflows/selfhost.yml path-filter edit
  • Manual verification: node scripts/build-selfhost.mjs --all (Dockerfile's exact build invocation) then grep -c "cloudflare:" dist/server.mjs0
  • This PR touches .github/workflows/selfhost.yml and effectively Dockerfile's own build inputs, so CI's dedicated "build + boot smoke test" job (real docker buildx build + container boot + /health//ready//metrics checks) will run and is the authoritative confirmation that the image still boots cleanly without this script
  • npm run test:workers / npm run build:mcp / npm run test:mcp-pack / npm audit / ui:* — not run locally; no worker-pool, MCP-package, or UI files touched. CI runs the full gate.

If any required check was skipped, explain why:

  • test:coverage/test:ci not run locally — this diff is a script deletion + a 2-line CI path-filter removal, zero src/**/test/** changes, so there is nothing for Codecov's patch-coverage gate to evaluate. CI's self-host workflow (which WILL run on this PR, since it touches that workflow's own paths) is the real validation for this specific change.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no API/schema/MCP surface touched.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (N/A — no changelog edit.)

…int script

Its own header claimed it was used as the Docker entry via
`node --import ./scripts/register-selfhost.mjs dist/server.mjs`, but the
Dockerfile CMD has no --import flag, and no other script/doc/workflow step
ever invoked it that way -- only a stale CI path filter referenced the
file's existence, not its runtime use.

Verified empirically rather than just by inspection: rebuilt the self-host
bundle with `node scripts/build-selfhost.mjs --all` (the exact mode the
Dockerfile's own build step uses) and grepped the resulting fully-bundled
dist/server.mjs for any `cloudflare:` string -- zero matches. The build-time
esbuild stub plugin (cloudflare:workers / @cloudflare/puppeteer / agents/mcp)
already eliminates every reachable cloudflare:* specifier from the actual
Docker image, including transitive node_modules internals, so the runtime
--import hook this script provided was fully redundant.

Removes the script and its stale reference in
.github/workflows/selfhost.yml's path filters.
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 4, 2026
@loopover-orb

loopover-orb Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-04 06:07:27 UTC

2 files · 1 AI reviewer · 1 blocker · readiness 100/100 · CI pending · blocked

⏸️ Suggested Action - Manual Review

  • Maintainer test expectations unmet — Add or update tests, or attach passing validation output that satisfies the maintainer's test expectations.

Review summary
The diff cleanly removes an unused self-host runtime hook and drops its stale workflow path filters, leaving the self-host workflow focused on files that still exist. Given the provided post-change workflow and related context, there is no visible remaining runtime dependency on `scripts/register-selfhost.mjs`; the Docker smoke path still builds and boots through `dist/server.mjs`. The notable residual risk is process-oriented: the PR relies on an out-of-band empirical grep/build claim rather than adding a durable check that future bundle changes do not reintroduce raw `cloudflare:` specifiers.

Nits — 4 non-blocking
  • nit: `.github/workflows/selfhost.yml` keeps bundle validation but does not encode the PR's claimed `cloudflare:` absence check, so the invariant can regress without a focused failure at the source of the removed hook.
  • Add a small validation step near `.github/workflows/selfhost.yml`'s self-host bundle build that greps `dist/server.mjs` for raw `cloudflare:` specifiers, or fold that assertion into `scripts/validate-selfhost-sourcemap.mjs` / the self-host build validation path so this deletion stays protected.
  • PR author also opened the linked issue — Link an issue that was opened by a different contributor, or provide a rationale for why this self-authored issue represents genuine discovery work.
  • Code changes lack test evidence — Add focused regression tests or explain why existing coverage is sufficient.

Concerns raised — review before merging

  • Maintainer test expectations unmet — Add or update tests, or attach passing validation output that satisfies the maintainer's test expectations.
Signal Result Evidence
Code review ❌ 1 blocker 1 reviewer
Linked issue ✅ Linked #2909
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 60 registered-repo PR(s), 51 merged, 437 issue(s).
Contributor context ✅ Confirmed Gittensor contributor JSONbored; Gittensor profile; 60 PR(s), 437 issue(s).
Gate result ❌ Blocking Repo-configured hard blocker found.
Review context
  • Author: JSONbored
  • Role context: owner (maintainer lane)
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 60 PR(s), 437 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Treat this as maintainer-lane context rather than normal contributor-lane activity.
  • No action.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.05%. Comparing base (8771b85) to head (32218ac).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2937   +/-   ##
=======================================
  Coverage   96.05%   96.05%           
=======================================
  Files         259      259           
  Lines       28461    28461           
  Branches    10351    10351           
=======================================
  Hits        27339    27339           
  Misses        489      489           
  Partials      633      633           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 44f3b49 into main Jul 4, 2026
12 checks passed
@JSONbored
JSONbored deleted the claude/register-selfhost-orphan-2909 branch July 4, 2026 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Development

Successfully merging this pull request may close these issues.

chore(selfhost): resolve orphaned register-selfhost.mjs Docker entrypoint script

1 participant